import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: 'home'
    },
    {
      path: '/order',
      name: 'order',
      meta: {
        title: '订单'
      },
      component: () => import('@/views/OrderView.vue')
    },
    {
      path: '/collect',
      name: 'collect',
      meta: {
        title: '收藏'
      },
      component: () => import('@/views/CollectView.vue')
    },
    {
      path: '/shopcart',
      name: 'shopcart',
      meta: {
        title: '购物车'
      },
      component: () => import('@/views/ShopCartView.vue')
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页'
      },
      component: () => import('@/views/HomeView.vue')
    },
    {
      path: '/goods',
      name: 'goods',
      meta: {
        title: '商品'
      },
      component: () => import('@/views/GoodsView.vue')
    },
    {
      path: '/about',
      name: 'about',
      meta: {
        title: '关于'
      },
      component: () => import('@/views/AboutView.vue')
    },
    {
      path: '/detail',
      name: 'detail',
      meta: {
        title: '详情'
      },
      component: () => import('@/views/GoodsDetail.vue')
    }
  ]
})

export default router
